using System.Linq.Expressions;

namespace BabyShop.Site.Data.Conventions.Properties
{
    public abstract class PropertyExpressionConventionBase : IPropertyExpressionConvention
    {
        protected PropertyExpressionConventionBase(int order) {
            Order = order;
        }

        public int Order { get; set; }

        public abstract Expression BuildExpression(BuildPropertyExpressionContext context);

        public override string ToString() {
            return string.Format("{0,8}    {1}", Order, this.GetType().Name.Replace("Convention", ""));
        }
    }
}